<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>核销统计</title>
    <link rel="shortcut icon" href="favicon.ico"> <link href="<%=path%>/hplus/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="<%=path%>/hplus/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="<%=path%>/hplus/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="<%=path%>/hplus/css/plugins/footable/footable.core.css" rel="stylesheet">
        <link rel="stylesheet" type="text/css" href="<%=path%>/hplus/css/plugins/dataTables/css/jquery.dataTables.min.css"/>
    <link href="<%=path%>/hplus/css/animate.min.css" rel="stylesheet">
    <link href="<%=path%>/hplus/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link href="<%=path%>/hplus/css/plugins/chosen/chosen.css" rel="stylesheet">
    <link href="<%=path%>/hplus/css/plugins/colorpicker/css/bootstrap-colorpicker.min.css" rel="stylesheet">
    <link href="<%=path%>/hplus/css/plugins/cropper/cropper.min.css" rel="stylesheet">
    <link href="<%=path%>/hplus/css/plugins/switchery/switchery.css" rel="stylesheet">
    <link href="<%=path%>/hplus/css/plugins/jasny/jasny-bootstrap.min.css" rel="stylesheet">
    <link href="<%=path%>/hplus/css/plugins/nouslider/jquery.nouislider.css" rel="stylesheet">
    <link href="<%=path%>/hplus/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
    <link href="<%=path%>/hplus/css/plugins/ionRangeSlider/ion.rangeSlider.css" rel="stylesheet">
    <link href="<%=path%>/hplus/css/plugins/ionRangeSlider/ion.rangeSlider.skinFlat.css" rel="stylesheet">
    <link href="<%=path%>/hplus/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet">
    <link href="<%=path%>/hplus/css/plugins/clockpicker/clockpicker.css" rel="stylesheet">
    <style> 
        .col-sm-1{
            font-weight: normal;
        }  
        table.dataTable tbody th, table.dataTable tbody td{
        padding:10;
        }  
        
          
    </style>
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content">
        <div class="col-md-12 ibox-content">
            <form class="form-horizontal">
               <!--  <div class="col-sm-3">
                    <div class="input-group">
                        <input id="keyWord" type="text" placeholder="批次名称搜索" class="input form-control">
                        <span class="input-group-btn">
                            <button onclick="javascript:search();" type="button" class="btn btn btn-primary"> <i class="fa fa-search"></i> 搜索</button>
                        </span>
                    </div>
                </div>
            
                <div class="form-group col-sm-4" id="data_5">
                    <div class="input-daterange input-group" id="datepicker">
                        <input id="start_time" type="text" class="input-sm form-control" name="start" value="2017-9-11" />
                        <span class="input-group-addon">到</span>
                        <input id="end_time" type="text" class="input-sm form-control" name="end" value="2017-9-17" />
                    </div>
                </div>               
                <div class="col-sm-1">
                    <button onclick="javascript:filterTime();" type="button" class="btn btn-primary pull-right" >筛选</button>
                </div> -->
                <div class="col-md-12 text-right">
                    <button onclick="javascript:exportDatas();" class="btn btn-primary pull-right" type="button">导出表单</button>
                </div>
            </form> 
             <div class="col-sm-12" style="margin-top:20px;">
                <div class="ibox float-e-margins">
                    <div class="table-responsive">
                        <table class="display  table-striped table-bordered table-hover" id="mydataTable">
                            <thead>
                                <tr>
                                   <th>姓名</th>
                                    <th>电话</th>
                                    <th>邮箱</th>
                                    <th>性别</th>
                                    <th>城市</th>
                                    <th>核销券</th>
                                    <th>时间</th>
                                </tr>
                            </thead>
                            <tbody>
                               
                            </tbody>
                        </table>
                    </div>                 
                </div>
            </div>
        </div>      
    </div>
    <script src="<%=path%>/hplus/js/jquery.min.js?v=2.1.4"></script>
    <script src="<%=path%>/hplus/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="<%=path%>/hplus/js/plugins/iCheck/icheck.min.js"></script>
    <script type="text/javascript" src="<%=path%>/hplus/js/plugins/dataTables/jquery.dataTables.min.js"></script>
    <script src="<%=path%>/hplus/js/plugins/sweetalert/sweetalert2.min.js"></script>
    <script type="text/javascript" src="<%=path%>/js/marketing/dialog.js"></script>
	<script type="text/javascript" src="<%=path%>/js/marketing/public.js"></script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
	<script src="<%=path%>/hplus/js/plugins/sweetalert/sweetalert2.min.js"></script>
    <script>
	    var path = "<%=path%>";
	    var myDataTable;
	    var access_token=$.cookie('access_token');
	   	var cid=$.cookie('cid');
	   	var uid=$.cookie('uid');
	   	var batchId;
	   	$.fn.dataTable.ext.errMode = 'none';
        $(function(){
        	init();
        	
        });
        
        function init(){
        	batchId=getQueryString("id");
        	
        	myDataTable = dataTable();
        	
        }
        
        function func_dataTableReload(){
        	myDataTable.ajax.reload(function(){
        		$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green"});
        		$('input').iCheck('uncheck');
        	});
        }
        
        
        function dataTable(){
        	return $('#mydataTable').DataTable({
        		processing: true,
        		ordering: false,
        		searching: false,
        		info: true,
        		autoWidth: true,
        		lengthChange: false,
        		"order": [[ 2, "desc" ]],
        	    language: {
        	    	emptyTable: '<div id="content_empty"  class="form-group white-bg" style="text-align:center;padding:200px 0;margin:0;">   <p>暂无转化数据</p></div>',
        	    	info: '从第 _START_ 到第 _END_ 条数据；总共有 _TOTAL_ 条记录',
        			infoEmpty: '没有数据',
        			lengthMenu: '每页显示 _MENU_ 条记录',
        			loadingRecords: '正在加载数据....',
        			processing: '正在处理数据....',
        			zeroRecords: '没有找到匹配的记录',
        			paginate: {
        				first: '首页',
        				previous: '前页',
        				next: '后页',
        				last: '尾页'
        			}
        	    },
        	    order: [[1,'desc']],
        		pageLength: 10,
        	    pagingType: 'full_numbers',
        	    columnDefs: [],
        	    columns: func_columns(),
        	    serverSide: true,
        	    ajax: {
        	    	contentType: 'application/json;charset=utf-8',
        	    	type: 'POST',
        	    	url: func_AjaxUrl(),
        	    	data: function(d){
        	    		d.batchId=batchId;
        				return JSON.stringify(d);
        			}
        		} ,
        	    "initComplete": function(settings, json) {
        	    	$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",});
        	    	var info=myDataTable.page.info(); 
                    if(json.error_code=="20028"){
                    	loginDialog();
                    }else{
                    	/* if(info.recordsTotal<1){
                    		createDialog()
                    	} */
                    }     	    	
                	
        	    
        	    }
        	});
        	
        }
        
        function func_AjaxUrl(){
        	return path+"/socialCouponBatch/ajaxConverStatistics";
        }
        /**
         *	设置列名，对应后台
         */
        function func_columns(){
        	var jsonArr = [
        		{"data":"name"},
        		{"data":"phone"},
        		{"data":"email"},
        		{"data":"gender"},
        		{"data":"city"},
        		{"data":"tempName"},
        		{"data":"create_time"},
        	];
        	return jsonArr;
        }
        function exportDatas(){
        	window.location.href=path+"/socialCouponBatch/exportConverForm?batchId="+batchId;
        }
    </script>
    <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
</body>
</html>
